"""
应用配置
"""
from typing import Dict, List
import json
import os


class AppConfig:
    """
    应用配置类
    """
    _config_path = os.path.join(os.path.dirname(__file__), "configs")
    
    @classmethod
    def _load_config(cls, filename: str) -> Dict[str, Any]:
        """加载JSON配置文件"""
        try:
            with open(os.path.join(cls._config_path, filename), "r", encoding="utf-8") as f:
                return json.load(f)
        except (FileNotFoundError, json.JSONDecodeError):
            return {}
    
    @classmethod
    def get_scene_types(cls) -> Dict[str, str]:
        """
        获取场景类型
        """
        return cls._load_config("scene_types.json") or {
            "default": "默认场景",
            "calculation": "计算场景",
            "analysis": "分析场景"
        }

    @classmethod
    def get_process_steps(cls, scene_type: str) -> List[str]:
        """
        获取流程步骤
        """
        steps = cls._load_config("process_steps.json")
        return steps.get(scene_type, ["初始化", "执行", "完成"])